package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Department;
import service.DepartmentService;
import service.impl.DepartmentServiceImpl;



@WebServlet("/DoRegisterServlet")
public class DoRegisterServlet extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO 自动生成的方法存根
		//访问department的service层，返回数据
		DepartmentService ds=new DepartmentServiceImpl();
		List<Department> departmentList=ds.selectAllDepartments();
		req.setAttribute("departmentList", departmentList);
		//转向到register.jsp页面
		req.getRequestDispatcher("register.jsp").forward(req, resp);
		
		
	}

}
